const baseUrl = '/api'

// local
// const baseUrl = 'http://127.0.0.1/'

const request = (url, date, type,) => {
    return new Promise((resolve, reject) => {
        uni.request({
            method: type,
            url: baseUrl + url,
            data: date,
            header: {
                "authority": uni.getStorageSync('userInfo').token || ''
            },
            dataType: 'json',
			success:(res)=>{
				resolve(res.data);
			},
			fail:(err)=>{
				 reject(err)
			}
        })
    });
}
export default request
